package router

import (
	"github.com/gin-gonic/gin"
	"github.com/gorilla/csrf"
	"net/http"
)

// json
func GetLogin(c *gin.Context) {
	c.JSON(
		http.StatusOK,
		gin.H{
			"status": "200",
			"message": "hello",
	})
}

func PostLogin(c *gin.Context) {
	c.JSON(
		http.StatusOK,
		gin.H{
			"status": "200",
			"message": "world",
		})
}

// html
func GetLogin2(c *gin.Context) {
	c.HTML(
		http.StatusOK,
		"login.html",
		gin.H{
			"status": "200",
			"message": "hello",
			csrf.TemplateTag: csrf.TemplateField(c.Request),
		})
}

func PostLogin2(c *gin.Context) {
	c.JSON(
		http.StatusOK,
		gin.H{
			"status": "200",
			"message": "world",
		})
}